<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Advertiser registration</title>
</head>
<body>
	<table>
		<form:form action="${pageContext.request.contextPath}/advertisers/register" modelAttribute="newAdvertiser" method="POST">
			<tr>
				<td>
					<form:label path="username">Username</form:label>
				</td>
				<td>
					<form:input type="text" placeholder="username" path="username" required="true" id="username"/> 
					<div id="usernameExistsError"></div>
					<form:errors path="username"></form:errors>
				</td>
			</tr>
			<tr>
				<td>
					<form:label path="password">Password</form:label>
				</td>
				<td>
					<form:input type="password" placeholder="Password" path="password" required="true" />
					<form:errors path="password"></form:errors>
				</td>
			</tr>
			<tr>
				<td>
					<form:label path="advertiserType">Advertiser type</form:label>
				</td>
				<td>
					<form:select path="advertiserType" items="${ advertiserTypes }"></form:select>
					<form:errors path="advertiserType"></form:errors> 
				</td>
			</tr>
			<tr>
				<td>
					<form:label path="firstname">First name</form:label>
				</td>
				<td>
					<form:input type="text" placeholder="Firstname" path="firstname" />
					<form:errors path="firstname"></form:errors>
				</td>
			</tr>
			<tr>
				<td>
					<form:label path="lastname">Last name</form:label>
				</td>
				<td>
					<form:input type="text" placeholder="Lastname" path="lastname" />
					<form:errors path="lastname"></form:errors>
				</td>
			</tr>
			<tr>
				<td>
					<form:label path="email">Email</form:label>
				</td>
				<td>
					<form:input placeholder="Email" path="email" type="email" required="true" />
					<form:errors path="email"></form:errors>
				</td>
			</tr>
			<tr>
				<td>
					<form:label path="address">Address</form:label>
				</td>
				<td>
					<form:input type="text" placeholder="address" path="address" />
					<form:errors path="address"></form:errors>
				</td>
			</tr>
			<tr>
				<td>
					<form:label path="phoneNumber">Telephone number</form:label>
				</td>
				<td>
					<form:input type="text" placeholder="phoneNumber" path="phoneNumber" />
					<form:errors path="phoneNumber"></form:errors> 
				</td>
			</tr>
			<tr>
				<td>
					<input type="reset" value="Reset">
				</td>
				<td>
					<input type="submit" value="Register">
				</td>
			</tr>
		</form:form>
	</table>
</body>
</html>